package com.csnf.service;

import com.csnf.dao.UserDao;
import com.csnf.entity.User;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.sql.SQLException;
import java.util.List;

public class UserService {
    static UserDao userDao = new UserDao();
    public List<User> getAll() throws SQLException {
        return userDao.getAll();
    }
    public List<User> getUserNickName(String nickName) throws Exception {
        return userDao.getUserNickName(nickName);
    }
    public User getUserById(int id) throws Exception {
        return userDao.getUserById(id);
    }
    public static boolean updateUser(User user) throws Exception {
        return userDao.updateUser(user);
    }
    public static boolean deleteUser(Integer id) throws Exception {
        return userDao.deleteUser(id);
    }
}
